;; 我关于补全的设置
(mapc 'el-get2load-path (list "auto-complete"
			      "popup"
			      "pos-tip"
			      "fuzzy"))
(use-package yasnippet
 	:init
	(yas-global-mode 1)
)
(require 'auto-complete) ;; 加载 auto-complete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories ;; 字典位置
             "~/.emacs.d/el-get/auto-complete/dict")
;;使用增强列表
(require 'pos-tip)
(setq ac-quick-help-prefer-pos-tip)
(ac-config-default)
;;TAB的使用模式
(setq ac-dwim t)
;;添加backspac触发列表
(setq ac-trigger-commands
      (cons 'backward-delete-char-untabify ac-trigger-commands))
;;使用fuzzy功能
(setq ac-fuzzy-enable t)
;;添加ac补全源
(set-default 'ac-sources
             '(ac-source-yasnippet
	       ac-source-dictionary
	       ac-source-filename
	       ac-source-files-in-current-dir
	       ac-source-functions
	       ac-source-variables
	       ac-source-symbols
	       ac-source-features
	       ac-source-abbrev
	       ac-source-words-in-same-mode-buffers
	       ac-source-words-in-all-buffer
	       ))
;; yasnippet补全源的界面显示设置，这里颜色是橘红色的，用来与ac本身的补全相区分
(defface ac-yasnippet-candidate-face
  '((t (:background "sandybrown" :foreground "black")))
  "Face for yasnippet candidate.")
(defface ac-yasnippet-selection-face
  '((t (:background "coral3" :foreground "white")))
  "Face for the yasnippet selected candidate.")
(defvar ac-source-yasnippet
  '((candidates . ac-yasnippet-candidate)
    (action . yas/expand)
    (candidate-face . ac-yasnippet-candidate-face)
    (selection-face . ac-yasnippet-selection-face))
  "Source for Yasnippet.")
(provide 'complete)
